<?php
// No direct access to this file
defined('_JEXEC') or die;
 
// import the list field type
jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
 
/**
 * NGMenu Form Field class for the NGMenu component
 */
class JFormFieldItemStyles extends JFormFieldList
{
	/**
	 * The field type.
	 *
	 * @var		string
	 */
	protected $type = 'ItemStyles';
 
//	public function getLabel() {
//	}
 
	public function getInput() {
	
		$db		=& JFactory::getDBO();
		$query	= $db->getQuery(true);
	
		$query->select('id AS value, name AS text');
		$query->from('`#__ngmenu_itemstyle`');
		$query->order('name');
		$db->setQuery($query);
		$styles = $db->loadObjectList();

		$style_values = array();
		$style_values[] = JHtml::_('select.option', '0', JText::_('COM_NGMENU_LIST_VALUES_NONE2'));
		foreach($styles as $style){
			$style_values[] = JHtml::_('select.option', $style->value, $style->text);
		}
		
		return JHtml::_('select.genericlist', $style_values, $this->name, null, 'value', 'text', $this->value );
	}
}

